﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Coding4Fun.Toolkit.Controls"
    xmlns:converters="clr-namespace:Coding4Fun.Toolkit.Converters">

    <SolidColorBrush x:Key="FlyoutBorderBrush1" Value="{StaticResource ContrastBackgroundBrush}" />
	<SolidColorBrush x:Key="FlyoutBackgroundBrush1">#FFFFFFFF</SolidColorBrush>
	<x:String x:Key="SettingsFlyoutBackButtonGlyph1">&#xE0BA;</x:String>
	
	<converters:BrushToColorConverter x:Key="BrushToColor1" />
	<converters:ColorBrightnessConverter x:Key="ColorBrightness1" />
	<converters:ColorContrastConverter x:Key="ColorContrast1" />
	
	<x:String x:Key="SettingsFlyoutHeaderTextDefault1">Application Setting</x:String>

	<Style TargetType="local:RoundButtonGeneric">
		<Setter Property="BorderBrush" Value="{StaticResource ContrastBackgroundBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
		<Setter Property="FontFamily" Value="{StaticResource FontFamilySemiBold}"/>
		<Setter Property="FontSize" Value="12" />

		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:RoundButton">
					<Grid>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ContrastBackgroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ContrastBackgroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonForeground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackgroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonForeground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentBody">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>

									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

						<Rectangle Fill="Transparent" />
						<Border 
							Height="{TemplateBinding Height}"
							Width="{TemplateBinding Width}"
							Padding="{TemplateBinding Padding}" 
							BorderThickness="0" 
							BorderBrush="Transparent">
							<StackPanel 
								Orientation="{TemplateBinding Orientation}"
								VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">

								<Grid 
									Width="{TemplateBinding ButtonWidth}" 
									Height="{TemplateBinding ButtonHeight}" 
									Margin="0,-10, 0, 0">
									<Ellipse
										x:Name="ButtonBackground"
										Stroke="{TemplateBinding BorderBrush}" 
										StrokeThickness="3" 
										Fill="{TemplateBinding Background}" 
										Margin="{StaticResource TouchTargetOverhang}" />
									<Ellipse
										x:Name="ButtonForeground" 
										Fill="{TemplateBinding Foreground}" 
										Margin="{StaticResource TouchTargetOverhang}">
										<Ellipse.OpacityMask>
											<ImageBrush x:Name="OpacityImageBrush" Stretch="{TemplateBinding Stretch}" />
										</Ellipse.OpacityMask>
									</Ellipse>
								</Grid>

								<ContentControl 
									x:Name="ContentBody" 
									Content="{TemplateBinding Content}" 
									FontSize="{TemplateBinding FontSize}"
									Style="{StaticResource AppBarText}"/>
							</StackPanel>
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>